package avicit.bdp.dlm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import avicit.platform6.core.properties.PlatformConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * bdp_dlm_stat实体类
 *
 *
 * @author xugb
 * @date 2020/12/1 9:10
 */
@ApiModel(value = "DlmStatDTO", description = "bdp_dlm_stat")
@Table(name = "bdp_dlm_stat")
public class DlmStatDTO extends BaseDTO {


    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id
    @LogField
    @ApiModelProperty(value = "id", name = "id")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 统计日期
     */
    @LogField
    @ApiModelProperty(value = "统计日期", name = "statDate")
    @FieldRemark(column = "stat_date", field = "statDate", name = "统计日期")
    @Column(name = "stat_date")
    private String statDate;

    /**
     * 数据源ID
     */
    @LogField
    @ApiModelProperty(value = "数据源ID", name = "dataSourceId")
    @FieldRemark(column = "data_source_id", field = "dataSourceId", name = "数据源ID")
    @Column(name = "data_source_id")
    private String dataSourceId;

    /**
     * 数据源结构
     * 结构：0-结构化  1-非结构化 2-半结构化
     */
    @LogField
    @ApiModelProperty(value = "数据源结构", name = "dataSourceStructure")
    @FieldRemark(column = "structure", field = "dataSourceStructure", name = "数据源结构")
    @Column(name = "data_source_structure")
    private Integer dataSourceStructure;

    /**
     * 每日增量
     */
    @LogField
    @ApiModelProperty(value = "每日增量", name = "dayAmount")
    @FieldRemark(column = "day_amount", field = "dayAmount", name = "每日增量")
    @Column(name = "day_amount")
    private Long dayAmount;

    /**
     * 可用量
     */
    @LogField
    @ApiModelProperty(value = "可用量", name = "totalAmount")
    @FieldRemark(column = "total_amount", field = "totalAmount", name = "可用量")
    @Column(name = "total_amount")
    private Long totalAmount;

    /**
     * 表总数/文件总数/对象数量
     */
    @LogField
    @ApiModelProperty(value = "表总数/文件总数/对象数量", name = "count")
    @FieldRemark(column = "object_count", field = "count", name = "表总数/文件总数/对象数量")
    @Column(name = "object_count")
    private Long objectCount;

    /**
     * 存储组数量/桶数量
     */
    @LogField
    @ApiModelProperty(value = "存储组数量/桶数量", name = "otherCount")
    @FieldRemark(column = "other_count", field = "otherCount", name = "存储组数量/桶数量")
    @Column(name = "other_count")
    private Long otherCount;

    /**
     * 总容量
     */
    @LogField
    @ApiModelProperty(value = "总容量", name = "availableAmount")
    @FieldRemark(column = "available_amount", field = "availableAmount", name = "总容量")
    @Column(name = "available_amount")
    private Long availableAmount;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getStatDate() {
        return statDate;
    }

    public void setStatDate(String statDate) {
        this.statDate = statDate;
    }

    public String getDataSourceId() {
        return dataSourceId;
    }

    public void setDataSourceId(String dataSourceId) {
        this.dataSourceId = dataSourceId;
    }

    public Long getDayAmount() {
        return dayAmount;
    }

    public void setDayAmount(Long dayAmount) {
        this.dayAmount = dayAmount;
    }

    public Long getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Long totalAmount) {
        this.totalAmount = totalAmount;
    }

    public Long getObjectCount() {
        return objectCount;
    }

    public void setObjectCount(Long objectCount) {
        this.objectCount = objectCount;
    }

    public Long getOtherCount() {
        return otherCount;
    }

    public void setOtherCount(Long otherCount) {
        this.otherCount = otherCount;
    }

    public Long getAvailableAmount() {
        return availableAmount;
    }

    public void setAvailableAmount(Long availableAmount) {
        this.availableAmount = availableAmount;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "数据湖统计模块";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "数据湖统计";
        } else {
            return super.logTitle;
        }
    }

    @Override
    public PlatformConstant.LogType getLogType() {
        if (super.logType == null) {
            return PlatformConstant.LogType.module_operate;
        } else {
            return super.logType;
        }
    }

    public Integer getDataSourceStructure() {
        return dataSourceStructure;
    }

    public void setDataSourceStructure(Integer dataSourceStructure) {
        this.dataSourceStructure = dataSourceStructure;
    }

    @Override
    public String toString() {
        return "DlmStatDTO{" +
                "id='" + id + '\'' +
                ", statDate='" + statDate + '\'' +
                ", dataSourceId='" + dataSourceId + '\'' +
                ", dataSourceStructure='" + dataSourceStructure + '\'' +
                ", dayAmount=" + dayAmount +
                ", totalAmount=" + totalAmount +
                ", objectCount=" + objectCount +
                ", otherCount=" + otherCount +
                ", availableAmount=" + availableAmount +
                '}';
    }
}
